#!/usr/bin/env python
"""
# -*- coding: utf-8 -*-
# @Time    : 2020/10/3 11:51
# @Author  : AshJo
# @Desc    : 
# @Filename: __init__.py
# @Version : v1.0
"""

import hashlib


def get_md5(username, password):
    md5 = hashlib.md5(username.encode('utf-8'))
    md5.update(password.encode('utf-8'))
    return md5.hexdigest()


username = input('username:').strip()
password = input('password:').strip()
ret = get_md5(username, password)
with open('userinfo', encoding='utf-8', mode='a') as f:
    f.write(username + '|' + ret + '\n')
